import React,{Component} from 'react'
import style from "./style/header.module.scss"

class Header extends Component{
    getBack = () => {
        window.history.back(-1)
    }
    render(){
        return <div>
            <div className={style.header}>
                <div className={style.back} onClick={this.getBack}></div>
                <p className={style.title}>{this.props.title}</p>
            </div>
        </div>
    }
}



export default function header(Cmp,title) {
    return class extends  Component{
        render(){
            return <div>
                <Header title={title}></Header>
                <Cmp></Cmp>
            </div>
        }
    }
}

